<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Ingreso al sistema</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/estilos.css" media="screen" />
 <script type="text/javascript">
 
 function limpiar(nombre,obj){ 
	 if(obj.value=='Ingresar '+nombre){
		 obj.value='';
	 } 
 }
 
 
 function recargar(obj,nomnbre){ 
	 if(obj.value.trim().length==0){
		 obj.value='Ingresar '+nomnbre; 
	 }
 }
 
 function ingresar(){
	 limpiar('codigo',document.getElementById('usuLogin')); 
	 if(document.getElementById('password').value.trim().length==0  || document.getElementById('usuLogin').value.trim().length==0){
			 alert('Ingresar codigo y clave');
	 }else{
		 document.form.submit();	 
	 }
	 
	 
	 
 }
 
 </script>
</head> 

 

<body>

 
<form:form method="POST" name="form" action="${pageContext.request.contextPath}/validate">
 
	<center>Ingreso al sistema</center>
	<div   class="ventana_ovalada"  style="margin-left: auto;margin-right: auto; margin: auto; width:300px;background-image:url(${pageContext.request.contextPath}/imagenes/fondo-login.jpg);" >
	<br/>
	<c:if test="${not empty messageerror}" > <div  class="messageerror"> ${messageerror}</div></c:if>
	<br/> 
	<table class="form"    style="width:100%"  title="ingerso al sistema" > 
 
	    <tr>
	        <td align="center" ><form:input path="usuLogin"  alt="usuLogin" onfocus="limpiar('codigo',this);"  onblur="recargar(this,'codigo')"   /></td>
	    </tr>
	 
	    <tr> 
	        <td align="center"><form:password	 path="password" alt="password" onfocus="limpiar('clave',this);" onblur="recargar(this,'clave')"   /></td>
	    </tr>
	    <tr>
	        <td align="center" height="50" >
	            <span  class="button" onclick="ingresar();" >Ingresar</span>
	            <span class="button" >Recuperar clave</span> 
	              
	        </td>
	    </tr>
	</table>  
	<br/>
	<img   src="${pageContext.request.contextPath}/imagenes/candado.gif	" style="position:right;left: 15;bottom:  15;" width="15" height="15" >
	</div>
	  
	
</form:form>
</body>
</html>